<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/includeHeader.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
<%@ page import="com.kylin.module.shop.orm.*,com.kylin.common.util.*,com.kylin.common.dict.orm.Dict,com.kylin.common.paginate.DisplayPage,com.kylin.module.user.orm.*"%>

<script type="text/javascript">
	function sendInquiry()
	{
		if(checkboxStatus())
		{
			document.form1.action = "/module/shop/addInquiry.jsp";
			document.form1.submit();
		}else
			alert("请至少选择一个产品");
	}
	function checkboxStatus()
	{
		var c = document.getElementsByName("ids");
		for(var i=0;i<c.length;i++)
		{
			if(c[i].checked)
				return true;
		}
		return false;	
	}
</script>
<table class="tl05" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td class="prod" valign="top" memo="------列表所在格-------">
<table class="navi" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td>
					<%
						StringBuffer titleLinks = new StringBuffer("| 产品信息 | ");
						if (request.getAttribute("searchCatProduct") != null) {
							Dict cat = (Dict) request.getAttribute("searchCatProduct");
							if (cat.getParent() != null) {
								titleLinks.append("<a href=") 
								 .append("'/module/shop/shop.do?CMD=shopList")
								 .append("&parentCat=").append(cat.getParent().getId())
								 .append("'>").append(cat.getParent().getName())
								 .append("</a> | ");
							}
							titleLinks.append(cat.getName());
						}
						out.println(titleLinks);
					%>
					</td>
				</tr>
			</table>
			<mytag:MyActionMsg />
<div style="text-align:center; height:70px; valign:top"><script type="text/javascript"><!--
google_ad_client = "pub-6007578250513537";
/* 468x60, 创建于 08-5-13 */
google_ad_slot = "5206242207";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>

			<table class="prodt02" cellspacing="0" cellpadding="0">
			<tr>
		<td align="right" colspan="3">
		<input type="button" onclick="sendInquiry()" value="<bean:message key="inquire.buttonsend" />"></td>
				</tr>
				<tr>
					<td class="tl05pl"></td>
					<td class="tl05pm">
						<table width="100%" cellspacing="0" cellpadding="0">
							<tr>
								<td width="90" align="center">
									<bean:message key="product.02" />
								</td>
								<td align="center">
									<bean:message key="base.23" />
								</td>
							</tr>
						</table>
					</td>
					<td class="tl05pr"></td>
				</tr>
			</table>
			<table class="prodt03" cellspacing="0" cellpadding="0">
				<tr>
				</tr>
			</table>
		<form name="form1" action="" method="post">
			<table class="prodt01" cellspacing="0" cellpadding="0" memo="产品列表">

				<%
					if (request.getAttribute(Constants.KEY_REQUEST_RESULT) != null) {
						List list = (List) request.getAttribute(Constants.KEY_REQUEST_RESULT);

						for (int i = 0; i < list.size(); i++) {
							InquiryCar inquiry = (InquiryCar)list.get(i);
							Product p = inquiry.getProduct();
							Company c = inquiry.getCompany();
							User u = inquiry.getUser();
				%>
				<tr>
				
					<td class="prodt01l">

						<input type="checkbox" name="ids" value="<%=p.getId()%>" checked>
						<a href="/module/shop/company/shop.do?CMD=companyShopList&companyId=<%=c.getId()%>" target="_blank">
						   <img src="/fileOutServlet?imgType=<%=Constants.IMG_PRODUCT%>&imgurl=<%=p.getImgurl()%>" width="75" height="75">
				        </a>
					</td>
					<td class="prodt01r">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<img src="/images/arrowy.gif" width="11" height="11"
										align="absmiddle">
									<a
										href="/module/shop/company/shop.do?CMD=companyShopList&companyId=<%=p.getCompany().getId()%>"
										class="pron"> <%=p.getName()%>
									</a>
								</td>
							</tr>
							<tr>
								<td>
									<%=JspHelper.substring(JspHelper.checkNull(p.getIntroduce()).toString(),240,"...")%>
								</td>
							</tr>
							
							<tr>
								<td>
	<bean:message key="base.12"/><%=UTool.getCountryName(u.getCountry(),sessionLocale)%>&nbsp;&nbsp;&nbsp;&nbsp; 
		<bean:message key="company.31" /><%=JspHelper.checkNull(p.getCatproduct())%>
								</td>
							</tr>
							<tr>
								<td class="prodt01c">
									<img src="/images/arrowy.gif" width="11" height="11"
										align="absmiddle">
									<a href="/module/shop/company/shop.do?CMD=companyShopList&companyId=<%=c.getId()%>" target="_blank">
 										<%=c.getName()%> 
 									</a>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<%
					}
					}
				%>
			</table>
		</form>
		</td>
		<td class="tl05r" valign="top" memo="右边表格">
			<c:import url="/module/special/manageSpecial.do?CMD=listGlobalRight" />
		</td>
		<!-- 右边表格所在格结束  -->
	</tr>
</table>
<table class="prodt04" cellspacing="0" cellpadding="0" align="center"
	memo="下方查询条">
	<tr>
		<td>
			<form name="shopSearchBarForm" action="" method="post">
				<input type="hidden" name="parentCat">
				<input class="input01" name="name" type="text" size="26" />
				<select name="searchType" class="input01">
					<option value="product">
						<bean:message key="company.81"/>
					</option>
					<option value="seller">
						<bean:message key="company.78"/>
					</option>
					<option value="buy">
						<bean:message key="company.79"/>
					</option>
					<option value="company">
						<bean:message key="company.94"/>
					</option>
				</select>
				<%
					//构造 产品类别下拉菜单(一二两级)
					List maincatproduct = MemObjFactory.getDict("产品类别", sessionLocale
							.toString());
					boolean disableSelectParent = false;
					out.println(JspHelper.getCatProductSelect(maincatproduct,
							"catproduct", disableSelectParent));
				%>
				<mytag:national name="country" dictName="<%=Constants.ALLCOUNTRY%>" />
				<input type="button" onclick="search(document.shopSearchBarForm)"
					value="search" class="input01" />
		</form>
	</td>
</tr>
</table>
<table class="tl08" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td class="tl08l"></td>
		<td class="tl08m"></td>
		<td class="tl08r"></td>
	</tr>
</table>